package com.project.xy;

public class StudentGrade {
    private String name; // 学生姓名
    private String id; // 学号
    private String course; // 课程名称
    private double grade; // 成绩

    // 构造方法
    public StudentGrade(String name, String id, String course, double grade) {
        this.name = name;
        this.id = id;
        this.course = course;
        this.grade = grade;
    }

    // Getter 和 Setter 方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCourse() {
        return course;
    }

    public void setCourse(String course) {
        this.course = course;
    }

    public double getGrade() {
        return grade;
    }

    public void setGrade(double grade) {
        this.grade = grade;
    }

    // 重写 toString 方法，方便打印成绩信息
    @Override
    public String toString() {
        return "姓名：" + name + ", 学号：" + id + ", 课程：" + course + ", 成绩：" + grade;
    }
}